<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<a href="/excel/export">教职工信息表格模板下载</a>
<form id="person_info" style="margin-top: 20px">
    <input type="file" name="file" id="file">
    <input type="button" value="提交" onclick="person()">
</form>
<script type="text/javascript">
    function person() {

        var formData = new FormData;
        formData = $("#person_info")[0].files[0];
        formData.append('headImg', headImg);
        console.log(data);
        $.ajax({
            type: "post",
            url: ctx + "importExcel",
            data: data,
            async: false,
            cache: false,
            processData: false,
            contentType: false,
            success: function (msg) {
                console.log(msg);
                if(msg === 1){
                    alert("上传成功");
                }else{
                    alert("上传失败！");
                }
            },
            error: function (msg) {
                alert("上传失败！");
            }
        });

        // $("#info_submit").attr("data-dismiss", "modal");

        // window.location.reload();
    }

</script>
</body>
</html>